<?php
session_start();
include("includes/db.conn.php");
include("includes/conf.class.php");

$first_name=$_POST['first_name'];
$surname=$_POST['surname'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$country=$_POST['country'];
$invoice=$_POST['invoice'];
$totalprice=$_POST['totalprice'];

$sql=mysql_query("insert into netbiz_bookings(`first_name`,`last_name`,`email`,`phone`,`country`,`invoice`,`total_cost`) values('".$first_name."','".$surname."','".$email."','".$phone."','".$country."','".$invoice."','".$totalprice."')");

$booking_id=mysql_insert_id();
echo $booking_id;
$updateQuery=mysql_query("update netbiz_booking_details set booking_id=".$booking_id.",ispaid='y' where identity='".$_SESSION['booking']."'");
if($updateQuery)
{
	unset($_SESSION['booking']);
	session_destroy();

}
else
{
	mysql_error();
}
?>